<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$item=$this->plugin_setting('setting');
$return['adv']=$item['hdps'];
$return['footernav']=$item['footernav'];
if($_RQ['op']=='list'){	
	$return['sharedata']=array(
			'title'=>$item['share_title']?$item['share_title']:'我分享了一个拼车网站',
			'desc'=>$item['share_desc'],
			'link'=>custom_url('jy_cmspinche/index/',true),
			'imgUrl'=>ATTACHMENT_URL.$item['share_image'],
		);
	$data=get_postdata();
	//print_r($data);exit();
	//$pindex = max(1, intval($data['page']));
	$pindex = max(1, intval($_RQ['page']));
	$psize = 35;
	$params=array('uniacid'=>$_SESSION['uniacid'],'type'=>1,'status'=>1,'time >='=>time());
	if(!empty($data['key'])){
		$params['title like']='%'.trim($data['key']).'%';
	}
	$fields=array('id','title','start','end','createtime','price','status','time','name','mobile','people','self');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_cmspinche_list',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:i:s',$v['createtime']);
		$v['time']=date('Y-m-d H:i:s',$v['time']);
		if($v['self']){
			$v['self']='拼座';
		}else{
			$v['self']='不拼座';
		}
		
	}
	exi($return);
}


?>